home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Presen…tion Library 2 (Reseller) / Apple R&P Lib Reseller v2.0.iso / 4-Fonts & Software / Demo Software / AppMaker / Demo AppMaker™ / Demo AppMaker™.rsrc / TmpP_210_ModelessDialog.txt < prev    next >
Text File  |  1989-04-09  |  3KB  |  2 lines

  1. # (decoded with TMPL 11972)
  2. { %filename% -- modeless dialog }{ Created %date% %time% by AppMaker }Unit %unitname%;InterfaceUses%If MPW%    {$Load ToolBox.dump}        MemTypes,        QuickDraw,        OSIntf,        ToolIntf,        PackIntf,    {$Load}%end if%%If Think%{$ifc undefined Think_Pascal}    ListManager,{$endc}%end if%    ResourceDefs,    DialogAids;Type    %dlogname%Rec        = record        %DeclItems%    end;    %dlogname%Ptr        = ^%dlogname%Rec;    %dlogname%Handle    = ^%dlogname%Ptr;    Var    %dlogname%Dialog:    DialogPtr;{----------}Procedure Init%dlogname%;Procedure Do%dlogname%;Procedure Close%dlogname%;Function  Filter%dlogname%    (whichDialog:    DialogPtr;                     var event:            EventRecord;                     var itemHit:        integer): boolean;Procedure Do%dlogname%Item (itemNr:        integer);{----------}Implementation%If MPW%{$D+}{$R+}{$OV+}%end if%const    %ConstItems%%If MPW%{$S %unitname%}%end if%%ItemProcs%{----------}Procedure Init%dlogname%;var    theDialog:        DialogPtr;    %dlogname%Data:        %dlogname%Handle;Begin    %dlogname%Dialog := GetNewDialog (%dlogname%ID, nil, pointer (-1));    theDialog := %dlogname%Dialog;    SetPort (theDialog);    %dlogname%Data := %dlogname%Handle (NewHandle (sizeof (%dlogname%Rec)));    SetWRefCon (theDialog, longint (%dlogname%Data));    HLock (Handle (%Dlogname%Data));    with %dlogname%Data^^ do begin        %InitFields%        %SetItems%        %EnableItems%    end; {with}    HUnlock (Handle (%Dlogname%Data));End; {Init%dlogname%}{----------}Procedure Do%dlogname%;Begin    if %dlogname%Dialog <> nil then begin        SelectWindow (%dlogname%Dialog);        ShowWindow (%dlogname%Dialog);    end; {if}End; {Do%dlogname%}{----------}Procedure Close%dlogname%;Begin    HideWindow (%dlogname%Dialog);End; {Close%dlogname%}{----------}Function Filter%dlogname%    {(whichDialog:    DialogPtr;                      var event:        EventRecord;                      var itemHit:        integer): boolean};var    filtered:        boolean;Begin    filtered := false;    %FilterItems%    if not filtered then begin        filtered := StandardFilter (whichDialog, event, itemHit);    end;    Filter%dlogname% := filtered;End; {Filter%dlogname%}{----------}Procedure Do%dlogname%Item {(itemNr:    integer)};Var    theDialog:        DialogPtr;    %dlogname%Data:        %dlogname%Handle;Begin    theDialog := %dlogname%Dialog;    SetPort (theDialog);    %dlogname%Data := %dlogname%Handle (GetWRefCon (theDialog));    HLock (Handle (%Dlogname%Data));    with %dlogname%Data^^ do begin        case itemNr of            %HandleItems%        end; {case}        %EnableItems%    end; {with}    HUnlock (Handle (%Dlogname%Data));End; {Do%dlogname%Item}End. {%unitname%}